package com.jinzecloud.reportapproval.controller;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.jinzecloud.reportapproval.dto.Param;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.jinzecloud.reportapproval.bean.ReUser;
import com.jinzecloud.reportapproval.service.ReUserService;
import com.jinzecloud.reportapproval.utils.PageUtils;
import com.jinzecloud.reportapproval.utils.R;



/**
 * 用户表
 *
 * @author æ­å°
 * @email 1971240051@qq.com
 * @date 2024-09-03 12:10:44
 */
@RestController
@RequestMapping("reportApproval/reuser")
@Api(tags = "用户表", description = "用户表", value = "用户表")
public class ReUserController {
    @Autowired
    private ReUserService reUserService;

    /**
     * 列表
     */
    @RequestMapping(value = "/list",method = RequestMethod.POST)
    @ApiOperation(value = "用户表列表",notes = "用户表列表")
    //@RequiresPermissions("reportApproval:reuser:list")
    public R list(@RequestBody Param param){
        PageUtils page = reUserService.queryPage(param);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping(value = "/info/{usId}",method = RequestMethod.POST)
    @ApiOperation(value = "用户表信息",notes = "用户表信息")
    //@RequiresPermissions("reportApproval:reuser:info")
    public R info(@PathVariable("usId") Integer usId){
		ReUser reUser = reUserService.getById(usId);

        return R.ok().put("reUser", reUser);
    }

    /**
     * 保存
     */
    @RequestMapping(value = "/save",method = RequestMethod.POST)
    @ApiOperation(value = "用户表保存",notes = "用户表保存")
    //@RequiresPermissions("reportApproval:reuser:save")
    public R save(@RequestBody ReUser reUser){
		reUserService.save(reUser);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping(value = "/update",method = RequestMethod.POST)
    @ApiOperation(value = "用户表修改",notes = "用户表修改")
    //@RequiresPermissions("reportApproval:reuser:update")
    public R update(@RequestBody ReUser reUser){
		reUserService.updateById(reUser);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping(value = "/delete",method = RequestMethod.POST)
    @ApiOperation(value = "用户表删除",notes = "用户表删除")
    //@RequiresPermissions("reportApproval:reuser:delete")
    public R delete(@RequestBody Integer[] usIds){
		reUserService.removeByIds(Arrays.asList(usIds));

        return R.ok();
    }

}
